package com.bawei.park2211a.repair

import androidx.lifecycle.MutableLiveData
import com.bawei.base.bean.ReqairEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class RepairViewModel @Inject constructor(var apiService: ApiService) : BaseViewModel() {
    var reqairSuccess = MutableLiveData<MutableList<ReqairEntity>>()
     var updatareqairSuccess = MutableLiveData<ReqairEntity>()
    fun reqair() {
        httpRequest({ apiService.order() }, { reqairSuccess.postValue(it) })
    }

    fun updataRepair(id: Int, reqairEntity: ReqairEntity) {
        httpRequest({ apiService.updataRepair(id, reqairEntity) },
            { updatareqairSuccess.postValue(it) })
    }
}